package com.cordys.countconnector;
import com.eibus.soap.ApplicationTransaction;
import com.eibus.soap.BodyBlock;
import com.eibus.xml.nom.Node;
public class CountTransaction implements ApplicationTransaction {
static int count = 1;
public CountTransaction() {
// Count transaction constructor
}
// This function informs whether a request can be processed or not. The
// implementation type of the webservcie operation is checked against the
// list of types that can be processed by this connector.
public boolean canProcess(String type) {
return "Count".equals(type);
}
// Actual processing happens here
public boolean process(BodyBlock request, BodyBlock response) {
int responseNode = response.getXMLNode();
// Creating status tag in response which is returned as the response to the user
Node.getDocument(responseNode)
.createTextElement("status", "This is Method No " + count++,
responseNode);
return true;
}
//Code that Commits the transaction must come here
public void commit() {
}
//Code that aborts the transaction must come here
public void abort() {
}
}